package top.frsf.factory;

import top.frsf.enums.BulletTypeEnum;
import top.frsf.object.bullet.BulletObject;
import top.frsf.object.bullet.PesBullet;
import top.frsf.object.bullet.SnowPesBullet;

/**
 * 子弹工厂
 *
 * @author He Kuntao
 * @since 2025/8/4 11:12
 */
public class BulletFactory {

    /**
     * 创建子弹
     *
     * @param bulletType 子弹类型
     * @param x          x坐标
     * @param y          y坐标
     * @return 子弹对象
     */
    public static BulletObject createBullet(BulletTypeEnum bulletType, int x, int y) {
        switch (bulletType) {
            case PEA_BULLET:
                return new PesBullet( x, y);
            case SNOW_PEA_BULLET:
                return new SnowPesBullet( x, y);
            default:
                throw new IllegalArgumentException("Invalid bullet type");
        }
    }
}
